﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace intelliEssay.Interop
{
    /// <summary>
    /// This class contains paper type information 
    /// </summary>
    public class PaperTypeHelper
    {
        static PaperType[] paperTypes = new PaperType[] { new PaperType()
                                                                            { Name = "A4" ,
                                                                            Width=210,
                                                                            Height=297} };
        /// <summary>
        /// Paper type information
        /// </summary>
        public class PaperType
        {
            public string Name { get; set; }
            public double Width { get; set; }
            public double Height { get; set; }
        }
        /// <summary>
        /// Get paper type information by name
        /// </summary>
        /// <param name="name">the name of the paper, eg. A4, case insensitive</param>
        /// <returns></returns>
        public static PaperType GetPaperType(string name)
        {
            return (from paper in paperTypes where paper.Name == name select paper).First();
        }
    }
    /// <summary>
    /// Paper information that contains information on certain paper.
    /// </summary>
    public class PaperInformation
    {
        public static double[] GetPaperInformationByName(string name)
        {
            double[] ppinfoA4 = new double[] { 210, 297 };
            return ppinfoA4;
        }
        public static double GetEffectivePaperWidthDefaultSettingByName(string name)
        {
            return GetPaperInformationByName(name)[0] - 63.6;
        }
    }
}
